<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>首页品牌管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		
		function showImgDiv(url){
			$("#showImg").attr("src",url);
			$("#showImgDiv").show();
		}
		function closeImgDiv(){
			$("#showImg").attr("src","");
			$("#showImgDiv").hide();
		}
	</script>
	<style type="text/css">
	.BoxDiv{
			position:fixed;
			width:300px;
			height:326px;
			background:#f5f5f5;
			top:10%;
			left:25%;
			margin:0 auto;
			border:1px solid #CCC;
			box-shadow:3px 3px 10px 4px #DDD;
		}
	</style>
</head>
<body>

    <div style="display:none;" class="BoxDiv" id="showImgDiv">
		<img id="showImg" src="" style="width:300px;height:300px;">
		<div style="border-top:1px;">
			<input type="button" style="width: 300px;" value="关闭" onclick="closeImgDiv()">
		</div>
	</div>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/carBrand/">首页品牌列表</a></li>
		<%-- <shiro:hasPermission name="sys:carBrand:edit"><li><a href="${ctx}/sys/carBrand/form">首页品牌添加</a></li></shiro:hasPermission> --%>
	</ul>
	<%-- <form:form id="searchForm" modelAttribute="carBrand" action="${ctx}/sys/carBrand/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form> --%>
	<div style="display:none;">
		<sys:message content="${message}"/>
	</div>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>品牌</th>
				<th>图片</th>
				<th>链接</th>
				<th>备注</th>
				<shiro:hasPermission name="sys:carBrand:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="carBrand">
			<tr>
				<td>${carBrand.name }</td>
				<td><a href="javascript:;" onclick="showImgDiv('${carBrand.img}')">查看</a></td>
					<c:if test="${empty carBrand.url}">
				 <td>--</td>
				 </c:if>
				 <c:if test="${not empty carBrand.url}">
					<td><a href="${carBrand.url}">${carBrand.url}</a></td>
				 </c:if>
				<td>${carBrand.remarks }</td>
				<shiro:hasPermission name="sys:carBrand:edit"><td>
    				<a href="${ctx}/sys/carBrand/form?id=${carBrand.id}">编辑</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>